<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var borderwidth = 1;
    var tablewidth = 400;
    var tableheight = 400;
    var i = 0;
    var j = 0;
    document.write("<table border = '"+borderwidth+"' width = '"+tablewidth+"' height = '"+tablewidth+"'>")
    while(i < 4){
        document.write("<tr>");
        console.log(i);
        j=0;
        while(j < 4){
            console.log(j);
            document.write("<td>");
            document.write("&nbsp;&nbsp;");
            document.write("</td>");
            j++;
        }
        document.write("</tr>");
        i++;
    }
    document.write("</table>");
</script>
</html>